package com.vidmt.api.modules.sys.shiro;

import java.io.Serializable;

import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
import com.vidmt.api.modules.sys.entity.User;

public class MyPrincipal implements Serializable {

	private static final long serialVersionUID = 1L;
	private String displayName;
	private User user;
	private String os;
	private Integer ver;
	private String channel;

	public MyPrincipal(User user) {
		this.user = user;
		this.displayName = user.getDisplayName();
	}

	public User getUser() {
		return user;
	}

	/**
	 * 获取SESSIONID
	 */
	public String getSessionid() {
		try {
			return (String) UserUtils.getSession().getId();
		} catch (Exception e) {
			return "";
		}
	}

	public String getDisplayName() {
		return displayName;
	}

	@Override
	public String toString() {
		return displayName;
	}

	public String getOs() {
		return os;
	}

	public void setOs(String os) {
		this.os = os;
	}

	public Integer getVer() {
		return ver;
	}

	public void setVer(Integer ver) {
		this.ver = ver;
	}

	public String getChannel() {
		return channel;
	}

	public void setChannel(String channel) {
		this.channel = channel;
	}

}